﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

public partial class SellingSoln : System.Web.UI.Page
{
    Connectdbnour con = new Connectdbnour();
    protected void Page_Load(object sender, EventArgs e)
    {
        Label1.Text = GlobalClass.Client;
        Label2.Text = GlobalClass.DT;
    }
    protected void Button4_Click(object sender, EventArgs e)
    {
        if (con.connect().State != ConnectionState.Open)
        {
            con.connect().Open();
            SqlCommand sqlcom = new SqlCommand();
            sqlcom.Connection = con.connect();
            sqlcom.CommandType = CommandType.Text;
            sqlcom.CommandText = "select brandname,bottlesize,store1,store2 from soln where brandname='" + DropDownList2.SelectedItem.ToString() + "' and bottlesize=" + Convert.ToInt16(DropDownList19.SelectedItem.ToString());
            GridView1.DataSource = sqlcom.ExecuteReader();
            GridView1.DataBind();
            con.connect().Close();
            
        }
        con.connect().Close();
    }
    protected void Button5_Click(object sender, EventArgs e)
    {
        if (con.connect().State != ConnectionState.Open)
        {
            con.connect().Open();
            SqlCommand sqlcom = new SqlCommand();
            sqlcom.Connection = con.connect();
            sqlcom.CommandType = CommandType.Text;
            sqlcom.CommandText = "select name,store1,store2 from accs where name='" + DropDownList3.SelectedItem.ToString();
            GridView2.DataSource = sqlcom.ExecuteReader();
            GridView2.DataBind();
            con.connect().Close();

        }
        con.connect().Close();
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        con.Addfcsoln(DropDownList1.SelectedItem.ToString(), Label2.Text, Convert.ToInt16(Label1.Text), DropDownList2.SelectedItem.ToString(), Convert.ToInt16(DropDownList19.SelectedItem.ToString()), Convert.ToDouble(TextBox1.Text));
        Response.Redirect("SellingSoln.aspx");
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        con.Addfcaccs(DropDownList1.SelectedItem.ToString(), Label2.Text, Convert.ToInt16(Label1.Text), DropDownList3.SelectedItem.ToString(), Convert.ToDouble(TextBox2.Text));
        Response.Redirect("SellingSoln.aspx");
    }
    protected void Button3_Click(object sender, EventArgs e)
    {
        con.fctocsoln();
        Response.Redirect("SellingSoln.aspx");
    }
}